#include <iostream>
#include <vector>
using namespace std;

int main(int argc, char *argv[])
{
    int flag = 0;
    vector<int> a, b;
    int atmp, btmp;

    while (cin >> atmp >> btmp) {
        a.push_back(atmp);
        b.push_back(btmp);
    }

    for (int i = 0; i < a.size(); i++) {
        if (b[i] != 0) {
            if (flag != 0) {
                cout << " ";
            }
            cout << a[i] * b[i] << " " << b[i] - 1;
            flag = 1;
        }
    }
    cout << endl;

    if (flag = 0) {
        cout << "0 0" << endl;
    }

    return 0;
}
